{% block sw_customer_address_form %}
<div class="sw-customer-address-form">
    {% block sw_customer_address_form_container %}
    <sw-container
        columns="repeat(auto-fit, minmax(250px, 1fr))"
        gap="0px 30px"
    >
        {% block sw_customer_address_form_company_field %}

        <mt-text-field
            v-model="address.company"
            name="sw-field--address-company"
            :required="isBusinessAccountType"
            :label="$tc('sw-customer.addressForm.labelCompany')"
            :error="disabled ? null : addressCompanyError"
            :disabled="disabled"
            :placeholder="$tc('sw-customer.addressForm.placeholderCompany')"
        />
        {% endblock %}

        {% block sw_customer_address_form_department_field %}

        <mt-text-field
            v-model="address.department"
            name="sw-field--address-department"
            :label="$tc('sw-customer.addressForm.labelDepartment')"
            :error="disabled ? null : addressDepartmentError"
            :disabled="disabled"
            :placeholder="$tc('sw-customer.addressForm.placeholderDepartment')"
        />
        {% endblock %}

        {% block sw_customer_address_form_salutation_title_container %}
        {% block sw_customer_address_form_salutation_field %}
        <sw-entity-single-select
            v-model:value="address.salutationId"
            name="sw-field--address-salutationId"
            class="sw-customer-address-form__salutation-select"
            entity="salutation"
            :label="$tc('sw-customer.addressForm.labelSalutation')"
            :placeholder="$tc('sw-customer.addressForm.placeholderSalutation')"
            :error="disabled ? null : addressSalutationIdError"
            :disabled="disabled"
            :criteria="salutationCriteria"
            label-property="displayName"
        />
        {% endblock %}

        {% block sw_customer_address_form_title_field %}

        <mt-text-field
            v-model="address.title"
            name="sw-field--address-title"
            :label="$tc('sw-customer.addressForm.labelTitle')"
            :placeholder="$tc('sw-customer.addressForm.placeholderTitle')"
            :error="disabled ? null : addressTitleError"
            :disabled="disabled"
        />
        {% endblock %}
        {% endblock %}

        {% block sw_customer_address_form_first_name_field %}

        <mt-text-field
            v-model="address.firstName"
            name="sw-field--address-firstName"
            :label="$tc('sw-customer.addressForm.labelFirstName')"
            :placeholder="$tc('sw-customer.addressForm.placeholderFirstName')"
            validation="required"
            required
            :error="disabled ? null : addressFirstNameError"
            :disabled="disabled"
        />
        {% endblock %}

        {% block sw_customer_address_form_last_name_field %}

        <mt-text-field
            v-model="address.lastName"
            name="sw-field--address-lastName"
            :label="$tc('sw-customer.addressForm.labelLastName')"
            :placeholder="$tc('sw-customer.addressForm.placeholderLastName')"
            validation="required"
            required
            :error="disabled ? null : addressLastNameError"
            :disabled="disabled"
        />
        {% endblock %}

        {% block sw_customer_address_form_street_field %}

        <mt-text-field
            v-model="address.street"
            name="sw-field--address-street"
            :label="$tc('sw-customer.addressForm.labelStreet')"
            :placeholder="$tc('sw-customer.addressForm.placeholderStreet')"
            validation="required"
            required
            :error="disabled ? null : addressStreetError"
            :disabled="disabled"
        />
        {% endblock %}

        {% block sw_customer_address_form_additional_address_line_1_field %}

        <mt-text-field
            v-model="address.additionalAddressLine1"
            name="sw-field--address-additionalAddressLine1"
            :label="$tc('sw-customer.addressForm.labelAdditionalAddressLine1')"
            :placeholder="$tc('sw-customer.addressForm.placeholderAdditionalAddressLine1')"
            :error="disabled ? null : addressAdditionalAddressLine1Error"
            :disabled="disabled"
        />
        {% endblock %}

        {% block sw_customer_address_form_additional_address_line_2_field %}

        <mt-text-field
            v-model="address.additionalAddressLine2"
            name="sw-field--address-additionalAddressLine2"
            :label="$tc('sw-customer.addressForm.labelAdditionalAddressLine2')"
            :placeholder="$tc('sw-customer.addressForm.placeholderAdditionalAddressLine2')"
            :error="disabled ? null : addressAdditionalAddressLine2Error"
            :disabled="disabled"
        />
        {% endblock %}

        {% block sw_customer_address_form_zipcode_city_container %}
        {% block sw_customer_address_form_zipcode_field %}

        <mt-text-field
            v-model="address.zipcode"
            name="sw-field--address-zipcode"
            :label="$tc('sw-customer.addressForm.labelZipcode')"
            :placeholder="$tc('sw-customer.addressForm.placeholderZipcode')"
            validation="required"
            :required="country && country.postalCodeRequired"
            :error="disabled ? null : addressZipcodeError"
            :disabled="disabled"
        />
        {% endblock %}

        {% block sw_customer_address_form_city_field %}

        <mt-text-field
            v-model="address.city"
            name="sw-field--address-city"
            :label="$tc('sw-customer.addressForm.labelCity')"
            :placeholder="$tc('sw-customer.addressForm.placeholderCity')"
            validation="required"
            required
            :error="disabled ? null : addressCityError"
            :disabled="disabled"
        />
        {% endblock %}
        {% endblock %}

        {% block sw_customer_address_form_country_field %}
        <sw-entity-single-select
            v-model:value="countryId"
            name="sw-field--countryId"
            class="sw-customer-address-form__country-select"
            entity="country"
            :criteria="countryCriteria"
            :label="$tc('sw-customer.addressForm.labelCountry')"
            :placeholder="$tc('sw-customer.addressForm.placeholderCountry')"
            validation="required"
            required
            :error="disabled ? null : addressCountryIdError"
            :disabled="disabled"
            show-clearable-button
        />
        {% endblock %}

        {% block sw_customer_address_form_state_field %}
        <div
            v-if="countryId && hasStates"
            class="sw-customer-address-form__state-select-placeholder"
        >
            <sw-entity-single-select
                v-model:value="address.countryStateId"
                name="sw-field--address-countryStateId"
                class="sw-customer-address-form__state-select"
                entity="country_state"
                :criteria="stateCriteria"
                :label="$tc('sw-customer.addressForm.labelState')"
                :placeholder="$tc('sw-customer.addressForm.placeholderState')"
                :required="country && country.forceStateInRegistration"
                :error="disabled ? null : addressCountryStateIdError"
                :disabled="disabled"
                show-clearable-button
            />
        </div>
        {% endblock %}

        {% block sw_customer_address_form_phone_number_field %}

        <mt-text-field
            v-model="address.phoneNumber"
            name="sw-field--address-phoneNumber"
            :label="$tc('sw-customer.addressForm.labelPhoneNumber')"
            :placeholder="$tc('sw-customer.addressForm.placeholderPhoneNumber')"
            :error="disabled ? null : addressPhoneNumberError"
            :disabled="disabled"
        />
        {% endblock %}

        <slot v-bind="{ disabled }">
            {% block sw_customer_address_form_extension_slot %}
            {% endblock %}
        </slot>
    </sw-container>
    {% endblock %}
</div>
{% endblock %}
